<form id="add-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
    {:token()}
    <div class="form-group">
        <label for="name" class="control-label col-xs-12 col-sm-2">类型名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" id="name" name="row[name]" value=""
                   data-rule="required;name"/>
        </div>
    </div>
    <div class="form-group">
        <label for="name" class="control-label col-xs-12 col-sm-2">首页推荐:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[index_show]', ['normal'=>'是', 'hidden'=>'否'], 'hidden')}
        </div>
    </div>
    <div class="form-group">
        <label for="c-avatar" class="control-label col-xs-12 col-sm-2">轮播图:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-avatar" class="form-control" size="50" name="row[swiper_pics]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span>
                        <button type="button" id="faupload-avatar"
                                class="btn btn-danger faupload"
                                data-input-id="c-avatar"
                                data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                data-multiple="true"
                                data-preview-id="p-avatar">
                        <i class="fa fa-upload"></i> {:__('Upload')}</button>
                    </span>
                </div>
                <span class="msg-box n-right" for="c-avatar"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-avatar"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">样式:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[style_name]', $style_names, null, [
            'class'=>'form-control selectpicker',
            'onChange'=>'cg()'
            ])}
        </div>
    </div>

    <div class="panel panel-default panel-intro">
        <div class="panel-heading mb-3">
            <ul class="nav nav-tabs nav-group">
                {foreach name="style_names" id="vo" key="k"}
                    <li class="{if condition='($styleItem == $k)'} active {/if}">
                        <a href="#tab-{$k}" title="{$vo}" data-toggle="tab">
                            {$vo}
                        </a>
                    </li>
                {/foreach}
            </ul>
        </div>
        <div class="panel-body no-padding">
            <div id="myTabContent" class="tab-content">
                {foreach name="style_names" id="vo" key="k"}
                <div class="tab-pane fade {if condition='($styleItem == $k)'} active in {/if}" id="tab-{$k}">
                    {switch name="$k" }
                        {case value="item1"}
                            <!--    样式1 需要的数据 -->
                            <!--    报读方法 -->
                            <!--        院校 -->
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">推荐院校:</label>
                                <div class="col-xs-12 col-sm-8">
                                    {:build_select('row[rec_colleges][]', $recColleges,null, [
                                    'class'=>'form-control selectpicker', 'multiple'=>'' ])}
                                </div>
                            </div>
                            <!--        专业 -->
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">推荐专业:</label>
                                <div class="col-xs-12 col-sm-8">
                                    {:build_select('row[rec_profession][]', $recProfession,null, [
                                    'class'=>'form-control selectpicker', 'multiple'=>'' ])}
                                </div>
                            </div>
                            <!--        城市 -->
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">推荐城市:</label>
                                <div class="col-xs-12 col-sm-8">
                                    {:build_select('row[rec_city][]', $recCity, null, [
                                    'class'=>'form-control selectpicker', 'multiple'=>'' ])}
                                </div>
                            </div>
                            <!--    成考简介 -->
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">简介:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <textarea class="form-control" id="introduction" name="row[introduction]"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="c-avatar" class="control-label col-xs-12 col-sm-2">简介图:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input id="c-avatar-i" class="form-control" size="50" name="row[introduction_pics]" type="text" value="">
                                        <div class="input-group-addon no-border no-padding">
                                <span>
                                    <button type="button" id="faupload-avatar-1"
                                            class="btn btn-danger faupload"
                                            data-input-id="c-avatar-i"
                                            data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                            data-multiple="true"
                                            data-preview-id="p-avatar-i">
                                        <i class="fa fa-upload"></i> {:__('Upload')}</button>
                                </span>
                                        </div>
                                        <span class="msg-box n-right" for="c-avatar-i"></span>
                                    </div>
                                    <ul class="row list-inline faupload-preview" id="p-avatar-i"></ul>
                                </div>
                            </div>
                        {/case}
                        {case value="item2"}
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">推荐学院:</label>
                                <div class="col-xs-12 col-sm-8">
                                    {:build_select('row[top_colleges][]', $topColleges, null, [
                                    'class'=>'form-control selectpicker','multiple'=>'' ])}
                                </div>
                            </div>
                        {/case}
                        {case value="item3"}
                            <!-- 主图 -->
                            <div class="form-group">
                                <label for="c-avatar" class="control-label col-xs-12 col-sm-2">主图:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input id="c-avatar-m" class="form-control" size="50" name="row[itme3_main_pic]" type="text" value="">
                                        <div class="input-group-addon no-border no-padding">
                                            <span>
                                                <button type="button" id="faupload-avatar-m"
                                                        class="btn btn-danger faupload"
                                                        data-input-id="c-avatar-m"
                                                        data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                                        data-multiple="false"
                                                        data-preview-id="p-avatar-m">
                                                <i class="fa fa-upload"></i> {:__('Upload')}</button>
                                            </span>
                                        </div>
                                        <span class="msg-box n-right" for="c-avatar-m"></span>
                                    </div>
                                    <ul class="row list-inline faupload-preview" id="p-avatar-m"></ul>
                                </div>
                            </div>
                            <!--专科招生-楼层logo-->
                            <div class="form-group">
                                <label for="c-avatar" class="control-label col-xs-12 col-sm-2">专业楼层:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input id="c-avatar-major-pic" class="form-control" size="50" name="row[itme3_major_pic]" type="text" value="">
                                        <div class="input-group-addon no-border no-padding">
                                            <span>
                                                <button type="button" id="faupload-avatar-major-pic"
                                                        class="btn btn-danger faupload"
                                                        data-input-id="c-avatar-major-pic"
                                                        data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                                        data-multiple="false"
                                                        data-preview-id="p-avatar-major-pic">
                                                <i class="fa fa-upload"></i> {:__('Upload')}</button>
                                            </span>
                                        </div>
                                        <span class="msg-box n-right" for="c-avatar-major-pic"></span>
                                    </div>
                                    <ul class="row list-inline faupload-preview" id="p-avatar-major-pic"></ul>
                                </div>
                            </div>
                            <!--专科招生-列表-->
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">推荐专业:</label>
                                <div class="col-xs-12 col-sm-8">
                                    {:build_select('row[item3_major_rec][]', $recProfession,null, [
                                    'class'=>'form-control selectpicker', 'multiple'=>'' ])}
                                </div>
                            </div>
                            <!--招生院校-楼层logo-->
                            <div class="form-group">
                                <label for="c-avatar" class="control-label col-xs-12 col-sm-2">院校楼层:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input id="c-avatar-college-pic" class="form-control" size="50" name="row[itme3_col_pic]" type="text" value="">
                                        <div class="input-group-addon no-border no-padding">
                                                    <span>
                                                        <button type="button" id="faupload-avatar-college-pic"
                                                                class="btn btn-danger faupload"
                                                                data-input-id="c-avatar-college-pic"
                                                                data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                                                data-multiple="false"
                                                                data-preview-id="p-avatar-college-pic">
                                                        <i class="fa fa-upload"></i> {:__('Upload')}</button>
                                                    </span>
                                        </div>
                                        <span class="msg-box n-right" for="c-avatar-college-pic"></span>
                                    </div>
                                    <ul class="row list-inline faupload-preview" id="p-avatar-college-pic"></ul>
                                </div>
                            </div>
                            <!--招生院校-列表-->
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">推荐院校:</label>
                                <div class="col-xs-12 col-sm-8">
                                    {:build_select('row[item3_col_rec][]', $recColleges,null, [
                                    'class'=>'form-control selectpicker', 'multiple'=>'' ])}
                                </div>
                            </div>
                            <!--精讲名师-->
                            <div class="form-group">
                                <label for="c-avatar" class="control-label col-xs-12 col-sm-2">名师精讲:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input id="c-avatar-teacher-pic" class="form-control" size="50" name="row[itme3_teacher_pic]" type="text" value="">
                                        <div class="input-group-addon no-border no-padding">
                                            <span>
                                                <button type="button" id="faupload-avatar-teacher-pic"
                                                        class="btn btn-danger faupload"
                                                        data-input-id="c-avatar-teacher-pic"
                                                        data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                                        data-multiple="false"
                                                        data-preview-id="p-avatar-teacher-pic">
                                                <i class="fa fa-upload"></i> {:__('Upload')}</button>
                                            </span>
                                        </div>
                                        <span class="msg-box n-right" for="c-avatar-teacher-pic"></span>
                                    </div>
                                    <ul class="row list-inline faupload-preview" id="p-avatar-teacher-pic"></ul>
                                </div>
                            </div>
                            <!--详情介绍-->
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">简介:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <textarea class="form-control" name="row[item3_detail]"></textarea>
                                </div>
                            </div>
                        {/case}
                        {default /}
                            未有样式
                    {/switch}
                </div>
                {/foreach}
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')])}
        </div>
    </div>
    <div class="form-group hidden layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script>
    function cg() {
        console.log('onchange');
    }
</script>